package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingPlanDto;
import com.zzyl.dto.NursingPlanPageDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.entity.ProjectPlans;
import com.zzyl.vo.NursingPlanVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {
    @Select("select * from nursing_plan where is_delete = 0")
    List<NursingPlanVO> selectAll();

    Page<NursingPlanVO> pageCondition(NursingPlanPageDto nursingPlanPageDto);

    @Select("select * from nursing_plan where  id = #{id}")
    NursingPlanVO getById(Long id);

    List<ProjectPlans> getProjectsByPlanId(Long id);

    void update(NursingPlan nursingPlanDto);

    @Delete("delete from nursing_project_plan where plan_id = #{id}")
    void deleteProjectsByPlanId(Long id);

    void insertProject(List<ProjectPlans> projectPlans);

    void insert(NursingPlan nursingPlan);
}
